import cn.net.isir.common.AES;
import cn.net.isir.common.TokenManager;
import cn.net.isir.common.TransferAESUtils;
import cn.net.isir.utils.DateUtils;
import cn.net.isir.utils.StringUtils;
import org.apache.ibatis.ognl.Token;
import org.apache.log4j.Logger;
import org.apache.shiro.crypto.hash.Md5Hash;
import org.apache.shiro.crypto.hash.SimpleHash;

import java.nio.charset.StandardCharsets;
import java.util.Date;

/**
 * @author liuxubo
 * @filename A.java
 * @package PACKAGE_NAME
 * @email lxb@isir.net.cn
 * @date 2018/11/28
 * @comment
 * @since 1.8
 */
public class A {

    private static Logger logger = Logger.getLogger(A.class);

    public static void main(String[] args) throws Exception {
//        Logger.getRootLogger().info(new Md5Hash("ant.design", "admin").toHex());
//        logger.info(new SimpleHash("MD5", "ant.design", "admin", 1024));
//        logger.info(java.net.URLEncoder.encode("阿波次得额佛哥", "utf-8"));
//        logger.info(java.net.URLDecoder.decode("%E9%98%BF%E6%B3%A2%E6%AC%A1%E5%BE%97%E9%A2%9D%E4%BD%9B%E5%93%A5", "utf-8"));
//        logger.info(java.net.URLDecoder.decode("%E7%BE%8A%E8%82%89%E4%B8%B2", "utf-8"));
//        logger.info(123);
//        logger.info(new Date(new Date().getTime() + 7200 * 1000));
//        logger.info(DateUtils.format(new Date(), "YYYY-MM-dd HH:mm:ss"));
//        logger.info(java.net.URLEncoder.encode("https://yxiao2.com/minip?msg=78_1", StandardCharsets.UTF_8.name()));
//        logger.info("start");
//        logger.info(StringUtils.base64Encode("MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDNIwWFj+yMMgGWlWEt8EjqeWDb/zfWUU7QJeXIxfD/Dj0zptQLJ2a6mAvJQfHP6bpHDtyAbETz4WZoLcDxZYKGFgGsP/INgbcTdUa5+yojzyR7eX3iqdtSxkjxDmt5t10t0oXCWq9SH5c+Ah1v2lCZPaQu/i6ek+boK8EnN19qDI9Hj1LzUzvxo6Pw+XAziEiqKzHorpNuqMEw4YJVDAS2ldC+9MAS1j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BgQD9hIYWY7egvr8+TbZ6hKg83rfZw+pbYmske2Z3mc2Mr7hd4tlhtcPjb9m2zt8KI4Q7rolrkKdoYdNdoaTuosczhudcJQat9miShB/LOjYIaefmN771tOA3VQPvE3SN7ny8ruTPY46Qe5WF4xmjgFxbdZ5WQfSm9HuJnYboruqFHwKBgQDAy/2/B8fNSCuquMxLJ43LiwHIlZp8yzzkz4uWhGBxNW5IsLrpuH05WDALv5qnQoSknLM/+3xmJx9tzhy7uHHocebFuADd8z07g+aMKkel7SWnfMUzpzzP/6Hy2i1Z7AA+9E0XZjPktiIhMS1aX7P4GUTzimitKW2OEVjq+ZquNwKBgQCf+lzTDCH4YeY03r1kGwo/PxwtYyAkgrqxzt0eZAP933UsadZbfmQaxZ5RacH9l+P99WnqYuIBUJoc38BAhp/FuD+POh448OGUc6PMjvNB4/LeqBbs3jMPN6q/1zsZxYEZYBQretuf+Ryl3GV1c67UWCiOrhhAss6yTKGxe4+qaQKBgQCOlU6v/L0TYJCKzeionDQNmFxVT+7U5CnAvo1pX7VDhFRvheR1/W7+/e1qguWJVXRrmUgnxYGWutBPkONHIX18fuBA0XgyrTVX0pCqkIo0eFIkr+3X6ZLb8R6AUELCAfuck2iAKaGvP9O14Hy+HZEnpuiLhI0toznWm5W7EaYHuQKBgQDvAWfzdS7pQUymB8IAaNIoUYPM6XuYqleZ6x/rNf6lxO685SjuTg76HHUEJL2EEdjizc0jQC7Kp7npHIdZ24n3pCRH55gK9szJh8LcLtJd0s8hrMtwjTNPFY4wY7g8wx+27jMeqT1oblr0RrSmEVrsEUew6hkUSOD8vhDxUmU/iQ==", StandardCharsets.UTF_8.name()));
//        logger.info(java.net.URLDecoder.decode("%7B%22contact_info%22%3A%22%7B%7D%22%2C%22account%22%3A%222088702473676820%22%7D", StandardCharsets.UTF_8.name()));
//        logger.info(java.net.URLDecoder.decode("%7B%22extend_params%22%3A%7B%22sys_service_provider_id%22%3A%222088331092658973%22%7D%2C%22out_trade_no%22%3A%22129%22%2C%22total_amount%22%3A%220.02%22%2C%22subject%22%3A%22%E6%94%AF%E4%BB%98%E5%AE%9D%E5%BA%97%E9%93%BA1-%E7%82%B9%E9%A4%90%22%7D"));
//
//        logger.info(StringUtils.base64Encode("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4LwVChEscFkk7UcvyQuUjd58X0yenct2FHnJtc/l6xYMXqkWBmfglvAUETa9iuy4t0u1P0ZdsnuSFyVQcJeg6ZBDcxrn+BlSLiQvcWBvcVgY41dij0X7lOSD+hkOVeRBJHNwUpHyDgiL2MOklRjKmc6PxwSz5+vgefA4fhYs5fY0NncOzEhGxpP+SL10tvZn+jmwxT042v3Ly6+GBF2Bu7UnsZP5+AsD4EIebEFAekLzjKWWfAfB9s188JYGyIW5/eCOqXrXfbaDQ3Zz1+9uutIiklsWIFYOTASpACOv1PwAb2g0TXmNekJobHK8Yt024vesXbB27/mKLklLDOwJUwIDAQAB",StandardCharsets.UTF_8.name()));

//        logger.info(TokenManager.getTokenId());
//
//        logger.info(TokenManager.getMD5SaltPwd("admin","123456"));
        logger.info(TransferAESUtils.aesEncrypt("后即可拉伸的国防部你们都走","2e5119bf8abc419db9e62dc8aa797f6a"));
        logger.info(TransferAESUtils.aesDecrypt("CLTxQTa9Zeqw82c/id09SO3p4yz3pmD14iqYFZdOxF7cdjacAdA6cnSRMcwlwfo+","2e5119bf8abc419db9e62dc8aa797f6a"));
    }
}
